home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / veryba1a / learn.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1999-10-09  |  6.2 KB  |  214 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMain 
  3.    BackColor       =   &H0000FFFF&
  4.    ClientHeight    =   4170
  5.    ClientLeft      =   60
  6.    ClientTop       =   330
  7.    ClientWidth     =   4680
  8.    Icon            =   "learn.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   4170
  11.    ScaleWidth      =   4680
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.CommandButton Command6 
  14.       BackColor       =   &H00FFFFFF&
  15.       Caption         =   "Open CD tray"
  16.       Height          =   975
  17.       Left            =   0
  18.       Style           =   1  'Graphical
  19.       TabIndex        =   9
  20.       Top             =   2280
  21.       Width           =   1215
  22.    End
  23.    Begin VB.CommandButton Command5 
  24.       BackColor       =   &H00C00000&
  25.       Caption         =   "Close CD tray"
  26.       Height          =   975
  27.       Left            =   1200
  28.       Style           =   1  'Graphical
  29.       TabIndex        =   8
  30.       Top             =   2280
  31.       Width           =   1215
  32.    End
  33.    Begin VB.Timer Timer1 
  34.       Interval        =   100
  35.       Left            =   120
  36.       Top             =   1680
  37.    End
  38.    Begin VB.CommandButton Command4 
  39.       BackColor       =   &H000000FF&
  40.       Caption         =   "Get The Message"
  41.       Height          =   495
  42.       Left            =   1200
  43.       Style           =   1  'Graphical
  44.       TabIndex        =   6
  45.       Top             =   1680
  46.       Width           =   1215
  47.    End
  48.    Begin VB.TextBox Text1 
  49.       BackColor       =   &H0000FF00&
  50.       Height          =   285
  51.       Left            =   1440
  52.       TabIndex        =   5
  53.       Text            =   "Unknown"
  54.       Top             =   1320
  55.       Width           =   3135
  56.    End
  57.    Begin VB.CommandButton Command3 
  58.       BackColor       =   &H00C00000&
  59.       Caption         =   "Clear"
  60.       Height          =   255
  61.       Left            =   3360
  62.       Style           =   1  'Graphical
  63.       TabIndex        =   4
  64.       Top             =   360
  65.       Width           =   1215
  66.    End
  67.    Begin VB.CommandButton Command2 
  68.       BackColor       =   &H00FFFFFF&
  69.       Caption         =   "Down"
  70.       Height          =   255
  71.       Left            =   1680
  72.       Style           =   1  'Graphical
  73.       TabIndex        =   3
  74.       Top             =   360
  75.       Width           =   1215
  76.    End
  77.    Begin VB.CommandButton Command1 
  78.       BackColor       =   &H000000FF&
  79.       Caption         =   "Up"
  80.       Height          =   255
  81.       Left            =   0
  82.       Style           =   1  'Graphical
  83.       TabIndex        =   2
  84.       Top             =   360
  85.       Width           =   1215
  86.    End
  87.    Begin VB.TextBox txtBottom 
  88.       BackColor       =   &H0000FF00&
  89.       Height          =   285
  90.       Left            =   0
  91.       TabIndex        =   1
  92.       Top             =   720
  93.       Width           =   4575
  94.    End
  95.    Begin VB.TextBox txtTop 
  96.       BackColor       =   &H0000FF00&
  97.       Height          =   285
  98.       Left            =   0
  99.       TabIndex        =   0
  100.       Top             =   0
  101.       Width           =   4575
  102.    End
  103.    Begin VB.Image Image1 
  104.       Height          =   2250
  105.       Left            =   2400
  106.       Picture         =   "learn.frx":030A
  107.       Top             =   1680
  108.       Width           =   2250
  109.    End
  110.    Begin VB.Label Label1 
  111.       BackColor       =   &H0000FFFF&
  112.       Caption         =   "Type In Your Name:"
  113.       Height          =   255
  114.       Left            =   0
  115.       TabIndex        =   7
  116.       Top             =   1320
  117.       Width           =   1695
  118.    End
  119. Attribute VB_Name = "frmMain"
  120. Attribute VB_GlobalNameSpace = False
  121. Attribute VB_Creatable = False
  122. Attribute VB_PredeclaredId = True
  123. Attribute VB_Exposed = False
  124. Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal _
  125. lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal _
  126. hWndCallback As Long) As Long
  127. Dim C As String
  128. Dim CO As Integer
  129. Dim FS As Long
  130. Private Sub Command1_Click()
  131. txtTop.Text = txtBottom.Text
  132. txtBottom.Text = ""
  133. End Sub
  134. Private Sub Command2_Click()
  135. txtBottom.Text = txtTop.Text
  136. txtTop.Text = ""
  137. End Sub
  138. Private Sub Command3_Click()
  139. txtBottom.Text = ""
  140. txtTop.Text = ""
  141. End Sub
  142. Private Sub Command4_Click()
  143. MsgBox "Hi " + Text1.Text, vbExclamation
  144. MsgBox Text1.Text + " Is The Coolest Person I know!", vbExclamation
  145. End Sub
  146. Private Sub Form_Load()
  147.     Timer1.Interval = 100
  148.     Me.Caption = "A learning Program, by ***VBwizzKID***"
  149.     C = Me.Caption
  150.     CO = Len(C) + 1
  151.     Me.Caption = ""
  152.     If Me.BorderStyle <> 2 Then
  153.         FS = Me.ScaleWidth + 250
  154.     Else
  155.         FS = Me.ScaleWidth + 500
  156.     End If
  157. End Sub
  158. Private Sub Form_Resize()
  159.     If Me.WindowState = 1 Then
  160.         FS = 3500
  161.     Else
  162.         FS = Me.ScaleWidth
  163.     End If
  164. End Sub
  165. Private Sub Image1_Click()
  166. MsgBox "Tornado Enterprises, This Program was coded by the ***VBwizzKID***", vbInformation
  167. End Sub
  168. Private Sub Timer1_Timer()
  169.     On Error GoTo ATH
  170.     Static C01 As Integer
  171.     Static CO2 As Integer
  172.     Static a As String
  173.     Dim R As String
  174.     Dim T As String
  175.     If CO > 0 Then
  176.         C01 = CO
  177.         T = Mid(C, C01, 1)
  178.         CO = CO - 1
  179.         R = " "
  180.         Mid(R, 1) = T
  181.         Me.Caption = R & Me.Caption
  182.     Else
  183.         a = a & " "
  184.         R = " "
  185.         Mid(R, 1) = a
  186.         Me.Caption = R & Me.Caption
  187.     End If
  188.     If CO2 >= FS Then
  189.         CO2 = 0
  190.         CO = Len(C)
  191.         Me.Caption = ""
  192.         GoTo XX
  193.     Else
  194.         CO2 = CO2 + 50
  195.     End If
  196.     Exit Sub
  197. End Sub
  198. Private Sub Command6_Click()
  199. MsgBox Text1.Text + " This may take a while so be patient!", vbExclamation
  200.   Dim Dummy As String
  201.   Dummy = vbmciSendString("set cdaudio door open", 0)
  202. End Sub
  203. Private Sub Command5_Click()
  204.   Dim Dummy As String
  205.   Dummy = vbmciSendString("set cdaudio door closed ", 0)
  206. End Sub
  207. Function vbmciSendString(ByVal Command As String, ByVal hWnd As Long) As String
  208.     Dim Buffer As String
  209.     Dim dwRet As Long
  210.     Buffer = Space$(100) ' Create a buffer
  211.     dwRet = mciSendString(Command, ByVal Buffer, Len(Buffer), hWnd)
  212.     vbmciSendString = Buffer
  213. End Function
  214.